package com.example.camerademo.camera1.utils;

import android.content.Context;
import android.os.Build;
import android.os.Environment;

/**
 * Created by 大草原水 on 2021/11/19
 */
public class FileUtil {
    //返回通用图片储存路径，统一在这个方法中，做android 10 的适配
    public static String getCommonSavePath(Context mContext) {
        String path = "";
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {//适配android 10
            path = mContext.getExternalFilesDir(Environment.DIRECTORY_PICTURES) + "";
        } else {
            path = Environment.getExternalStorageDirectory().getAbsolutePath();
        }
        return path;
    }

}
